import React, { Component, Children } from 'react'
import Mark from './Mark'

export default class Dialog extends Component {
    state = {
        flag: false
    }
    changeFlag = () => {
        this.setState({
            flag: true
        })
    }
    render() {
        const { flag } = this.state
        const { children } = this.props
        console.log(children)
        return (
            <div>
                <button onClick = {() => {
                    this.changeFlag()
                }}>显示弹框</button>
                {
                    flag? <Mark mark = { children }/>: ""
                }
                
            </div>
        )
    }
}
